class Animal {
  protected name: string
  type: string
  constructor(name: string, type: string) {
    this.name = name
    this.type = type
  }
  play(): void {
    console.log('爬楼梯')
  }
}

class Cat extends Animal {
  constructor(name: string, type: string) {
    super(name, type)
  }
  show() {
    console.log(this.name)
  }
}

const cat = new Cat('xiaohua', '短猫')
cat.play()

class Student {
  public readonly name: string
  private age: number
  protected weight: number
  constructor(name: string, age: number, weight: number) {
    this.name = name
    this.age = age
    this.weight = weight
  }
  showMessage() {
    console.log(this.age)
    console.log(this.weight)
  }
}

const stu = new Student('黎月', 24, 40)
// console.log(stu.age);
// console.log(stu.weight);
// stu.age = -1
// console.log(stu.age);
stu.showMessage()
console.log(stu.name)
// stu.name = "xiaofei"

export {}
